package com.classroom.smart.service;

import com.classroom.smart.mapper.RecruitMapper;
import com.classroom.smart.pojo.Recruit;
import com.classroom.smart.pojo.RecruitExample;
import com.classroom.smart.pojo.Teacher;
import com.classroom.smart.pojo.TeacherExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RecruitService {

    @Autowired
    private RecruitMapper recruitMapper;

    //添加用户
    public boolean addOne(Recruit recruit){
        int i = recruitMapper.insert(recruit);
        return i>0;
    }

    //根据姓名和personid查找用户
    public List selectByNamePersonid(String name, String personid){
        RecruitExample recruitExample = new RecruitExample();
        RecruitExample.Criteria criteria = recruitExample.createCriteria();
        criteria.andNameEqualTo(name);
        criteria.andPersonidEqualTo(personid);
        List<Recruit> recruits = recruitMapper.selectByExample(recruitExample);
        return recruits;
    }
}
